//package com.tongzhan.controller;
//
//import com.alibaba.csp.sentinel.annotation.SentinelResource;
//import com.tongzhan.handler.ServerBlockHandler;
//import org.apache.rocketmq.spring.core.RocketMQTemplate;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//@RestController
//public class ProductController {
//
//    @Autowired
//    private RocketMQTemplate rocketMQTemplate;
//
//    @RequestMapping("/getOk")
//    @SentinelResource(value = "getOk",blockHandler = "handlerException",blockHandlerClass = {ServerBlockHandler.class},fallback = "del_getOk")
//    public String getOk(){
////        Integer s = 10/0;
//        return "系统服务端正常运行 ------------------------------O(∩_∩)O哈哈~乡贤端7004";
//    }
//    @RequestMapping("/getTimeOut")
//    public String getTimeOut() throws InterruptedException {
////        Integer s = 10/0;
//        Thread.sleep(3000);
//        return "系统服务端超时运行 ------------------------------/(ㄒoㄒ)/~~乡贤端7004";
//    }
//
//    public String del_getOk() {
//        return "系统服务端出错了 ------------------------------/(ㄒoㄒ)/~~乡贤端7004";
//    }
//
//    @RequestMapping("/sendRocketMQ")
//    public String sendRocketMQ(){
//        rocketMQTemplate.convertAndSend("sendRocketMQ","这是消息中间件发送的消息乡贤端7004");
//        return "消息中间件发送的消息成功 ------------------------------O(∩_∩)O哈哈~乡贤端";
//    }
//}
